import axios from '@/libs/axios1'
let jsonHeaders = {'content-type': 'application/json;charset=UTF-8'}
let classrelation = '/self-study/classrelation'
//添加班级
export const addClass = classInfo =>{
  return axios({
    url:`${classrelation}/classManage/addClass`,
    method:'POST',
    headers:jsonHeaders,
    data:classInfo
  })
}

//修改班级
export const modifyClass = (id,classInfo) =>{
  return axios({
    url:`${classrelation}/classManage/updateClass?classId=${id}`,
    method:'POST',
    headers:jsonHeaders,
    data:classInfo
  })
}

//删除班级
export const delClass = id =>{
  return axios({
    url:`${classrelation}/classManage/delClass?classId=${id}`,
    method:'DELETE',
    headers:jsonHeaders
  })
}

//获取班级列表
export const queryClassList = params => {
  return axios({
    url:`${classrelation}/classManage/queryClass`,
    method:'get',
    headers:jsonHeaders,
    params:params
  })
}

//获取班级详情
export const queryClassInfo = params => {
  return axios({
    url:`${classrelation}/classManage/queryClassInfo`,
    method:'get',
    headers:jsonHeaders,
    params:params
  })
}

//获取教学班级成员
export const getClassUsers = params =>{
  return axios({
    url:`${classrelation}/classManage/queryStus`,
    method:'GET',
    headers:jsonHeaders,
    params:params
  })
}

//部署环境
export const deployClass = (classId,type,classNumberId,userIds) =>{
  return axios({
    url:`${classrelation}/experimentManage/experimentDeploy?classId=${classId}&type=${type}&classNumberId=${classNumberId}`,
    method:'POST',
    headers:jsonHeaders,
    data:userIds
  })
}

//批量销毁
export const batchExperimentDestroy = params =>{
  return axios({
    url:`${classrelation}/experimentManage/experimentDestroy`,
    method:'delete',
    data:params,
    headers:jsonHeaders
  })
}

//修改班级状态
export const updateClassStatus = (classId,status) =>{
  return axios({
    url:`${classrelation}/classManage/updateStatus?classId=${classId}&status=${status}`,
    method:'POST',
    headers:jsonHeaders
  })
}

//创建排课
export const addTeachSchedule = params =>{
  return axios({
    url:`${classrelation}/classNumber/CreateClassNumber`,
    method:'POST',
    data:params,
    headers:jsonHeaders
  })
}

//修改排课
export const updateTeachSchedule = params =>{
  return axios({
    url:`${classrelation}/classNumber/updateClassNumber`,
    method:'POST',
    data:params,
    headers:jsonHeaders
  })
}

//查询排课
export const queryTeachSchedule = params =>{
  return axios({
    url:`${classrelation}/classNumber/queryClassNumber`,
    method:'GET',
    headers:jsonHeaders,
    params:params
  })
}

//清空排课
export const delTeachSchedule = params =>{
  return axios({
    url:`${classrelation}/classNumber/deleteClassNumber`,
    method:'DELETE',
    headers:jsonHeaders,
    params:params
  })
}

//查询答题记录
export const answerRecord = classNumberId =>{
  return axios({
    url:`${classrelation}/statistics/expAnswer/${classNumberId}`,
    method:'GET',
    headers:jsonHeaders
  })
}

//视频学习统计
export const videoLearnStatictics = classNumberId =>{
  return axios({
    url:`${classrelation}/statistics/expVideo/${classNumberId}`,
    method:'GET',
    headers:jsonHeaders
  })
}

//查询投屏状态
export const queryCheckScreenStatus = params =>{
  return axios({
    url:`${classrelation}/classNumber/queryCheckScreenStatus`,
    method:'GET',
    params:params,
    headers:jsonHeaders
  })
}

//报告评分
export const scoreClassReport = params =>{
  return axios({
    url:`${classrelation}/classReport/modify`,
    method:'PUT',
    data:params,
    headers:jsonHeaders
  })
}

//查询班级课节报告
export const queryClassReport = params =>{
  return axios({
    url:`${classrelation}/classReport/pages`,
    method:'GET',
    params:params,
    headers:jsonHeaders
  })
}

//同步实验组教学学生
export const syncClassData = classId =>{
  return axios({
    url:`${classrelation}/classManage/syncStus?classId=${classId}`,
    method:'PUT',
    data:{},
    headers:jsonHeaders
  })
}

//查询部署列表
export const queryClassNumberList = (classId,params) =>{
  return axios({
    url:`${classrelation}/classNumber/queryClassNumberUserDeploy/${classId}`,
    method:'GET',
    params:params,
    headers:jsonHeaders
  })
}

/**
 * 获取课节详情
 * @param {*} classNumberId 
 * @returns 
 */
export const getClassNumberDetail = classNumberId =>{
  return axios({
    url:`${classrelation}/classNumber/deatail/${classNumberId}`,
    method:'GET',
    headers:jsonHeaders
  })
}

/**
 * 暂停课节
 * @param {*} classNumberId 
 * @returns 
 */
export const pauseClassNumber = classNumberId =>{
  return axios({
    url:`${classrelation}/classNumber/pause/${classNumberId}`,
    method:'post',
    headers:jsonHeaders
  })
}

/**
 * 恢复课节
 * @param {*} classNumberId 
 * @returns 
 */
 export const resumeClassNumber = classNumberId =>{
  return axios({
    url:`${classrelation}/classNumber/resume/${classNumberId}`,
    method:'post',
    headers:jsonHeaders
  })
}

/**
 * 结束课节
 * @param {*} classNumberId 
 * @returns 
 */
export const finishClassNumber = classNumberId =>{
  return axios({
    url:`${classrelation}/classNumber/finishClassNumber/${classNumberId}`,
    method:'post',
    headers:jsonHeaders
  })
}
//教学班年度排课统计  
export const getStatisticCourseYear = () =>{
  return axios({
    url:`${classrelation}/classNumber/statisticCourseYear`,
    method:'get',
    headers:jsonHeaders,
  })
}
//教学班年度排课统计  
export const getsSatisticClassById = (classId) =>{
  return axios({
    url:`${classrelation}/classNumber/statisticClassById/${classId}`,
    method:'get',
    headers:jsonHeaders,
  })
}